package com.gr.service.impl;

import com.gr.entity.Phone;
import com.gr.mapper.PhoneMapper;
import com.gr.service.PhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PhoneServiceImpl implements PhoneService {
    @Autowired
    private PhoneMapper phoneMapper;
    @Override
    public List<Phone> selectAll() {
        return phoneMapper.selectAll();
    }

    @Override
    public Phone selectPhoneById(Integer id) {
        return phoneMapper.selectPhoneById(id);
    }

    @Override
    public List<Phone> selectAllPhoneAndBrand() {
        return phoneMapper.selectAllPhoneAndBrand();
    }

    @Override
    public int selectPhoneCount() {
        return phoneMapper.selectPhoneCount();
    }

    @Override
    public void insertPhone(Phone phone) {
        phoneMapper.insertPhone(phone);
    }

    @Override
    public void deletePhoneById(Integer id) {
        phoneMapper.deletePhoneById(id);
    }

    @Override
    public void updatePhone(Phone phone) {
        phoneMapper.updatePhone(phone);
    }
}
